[##include file="common/header.tpl.php"##]
[##include file="common/nav.tpl.php"##]

<script type="text/javascript" src="[##$adminurl##]/static/js/chat/highcharts.js"></script>
<script type="text/javascript">
	var chart;
	jQuery(document).ready(function() {
		chart = new Highcharts.Chart({
			chart: {
				renderTo: 'chart_div',
				defaultSeriesType: 'spline'
			},
			title: {
				text: '在线统计'
			},
			subtitle: {
				text: '[##$cur_day##] (15分钟在线)'
			},
			xAxis: {
				type: 'datetime',
				gridLineWidth: 1,
				lineColor: '#000',
				tickColor: '#000',
				labels: {
					style: {
						color: '#000',
						font: '11px Trebuchet MS, Verdana, sans-serif'
					}
				}
			},
			yAxis: {
				min: 0,
				title: {
					text: ''
				},
				minorTickInterval: 'auto',
				lineColor: '#000',
				lineWidth: 1,
				tickWidth: 1,
				tickColor: '#000',
				labels: {
					style: {
						color: '#000',
						font: '11px Trebuchet MS, Verdana, sans-serif'
					}
				}
			},
			tooltip: {
				formatter: function() {
					return '' + Highcharts.dateFormat('%H:%M' , this.x) + ': ' + this.y;
				}
			},
			plotOptions: {
				spline: {
					lineWidth: 2,
					states: {
						hover: {
							lineWidth: 4
						}
					},
					marker: {
						enabled: false,
						states: {
							hover: {
								enabled: true,
								symbol: 'circle',
								radius: 5,
								lineWidth: 1
							}
						}
					},
					pointInterval: 300000, // one hour
					pointStart: Date.UTC(2011 , 1 , 1 , 0 , 0 , 0)
				}
			},
			series: [{
				name: '用户数',
				data: [
					[##foreach from=$onlines item=item##]
					[##$item.skeys##],
					[##/foreach##]
				]
			}, {
				name: '独立用户数',
				data: [
					[##foreach from=$onlines item=item##]
					[##$item.unique_uins##],
					[##/foreach##]
				]
			}]
		});
	});
</script>

<div id="main">
	<div id="chart_div" class="highcharts-container" style="height:400px; clear:both; min-width: 700px"></div>
</div>

[##include file="common/footer.tpl.php"##]